package cn.vinux.vitapollo.common.enums;

/**
 * @version V3.0
 * @Title: ResCodeEnum
 * @Company:
 * @Description: 统一返回码约定
 * * @date 2018/5/16 下午1:06
 */
public enum ResCodeEnum {

    SUCCESS(200, "OK"),
    INSERT_FAIL(601, "新增失败"),
    ERROR(500, "系统繁忙"),
    PARAMETER_ERROR(10000, "参数异常"),
    METHOD_ERROR(10001, "请求方式错误"),
    UNKONW_ERROR(-1, "未知错误"),
    PASSWORD_ERROR(10002, "密码错误"),
    FILE_FAIL(10003, "上传失败"),
    NOT_HAVE_DATA(10004, "暂无数据"),
    USERNAMER_ERROR(10000, "用户名不存在"),
    VRIFY_CODE_ERROR(10001, "验证码错误"),
    FAIL(0, "fail"),
    ADD_FAIL(10011, "添加失败"),
    DELETE_FAIL(10012, "删除失败"),
    DUPLICATE(10013, "数据重复"),
    GET_DATA_FAIL(10014, "暂无数据"),;

    private int code;
    private String msg;

    ResCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "ResCodeEnum{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                '}';
    }
}
